<template>
    <div class="header">
        <div class="header-left">
            <div class="iconfont back-icon">&#xe624;</div>
        </div>
        <router-link class="header-input"  tag="div" :to="{name:'City'}">
            <span class="iconfont">&#xe632;</span>
            输入城市/景点/游玩主题
        </router-link>
        <router-link class="header-right" to="/city" tag="div">
            {{this.city}}
            <span class="iconfont arrow-icon">&#xe619;</span>
        </router-link>
    </div>
</template>

<script>
import {mapState} from 'vuex'
export default {
  name: 'HomeHeader',
  computed: {
    ...mapState(['city'])
  },
  methods: {
    goSearchCity () {
      this.$router.push('/city')
    }
  },
}
</script>

<style lang="stylus" scoped>
@import '~styles/varibles.styl';
@import '~styles/mixins.styl';

  .header
    display: flex
    height: $headerHeight
    line-height: $headerHeight
    background: $bgColor
    color: #fff
    .header-left
      width: .64rem
      float: left
      text-align: center
      .back-icon
        font-size: .4rem
    .header-input
      flex: 1
      padding-left: .2rem
      margin-top: .12rem
      margin-left: .2rem
      height: .64rem
      line-height: .64rem
      background-color: #fff
      border-radius: .1rem
      color: #ccc
    .header-right
      max-width: 1.04rem
      ellipsis()
      padding: 0 .1rem
      float: right
      text-align: center
      .arrow-icon
        font-size: .3rem
        position: relative
        top: .01rem

</style>
